package com.biter;

import com.biter.util.Util;

import android.os.Handler;
import android.os.Message;
import android.util.Log;

public class loadBtcData {

	
	public static void getMarketData(final String marketTag,final String url,
			final backCall backcall) {
		final Handler handler = new Handler() {
			public void handleMessage(Message message) {
				backcall.setData(String.valueOf(message.obj), marketTag);
			}
		};
		new Thread() {
			@Override
			public void run() {
				String return_val;
				try {
					return_val = Util.getHtml(url, "UTF-8");
					Message message = new Message();
					message.obj = return_val;
					handler.sendMessage(message);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}.start();
	}

	public interface backCall {
		public void setData(String dataJson, String marketTag);
	}
}
